﻿using Asp.Versioning;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;

namespace Himp.TaskScheduling.V1
{
    [Area(TaskSchedulingRemoteServiceConsts.ModuleName)]
    [RemoteService(Name = TaskSchedulingRemoteServiceConsts.RemoteServiceName)]
    [Route("api/taskScheduling/bizflowConfig")]
    [ApiVersion("1.0")]
    [ApiController]
    [ControllerName("bizflowConfig")]
    public class BizflowConfigController : TaskSchedulingController, IBizflowConfigService
    {
        private IBizflowConfigService _bizflowConfigService;

        public BizflowConfigController(IBizflowConfigService bizflowConfigService)
        {
            _bizflowConfigService = bizflowConfigService;
        }

        [HttpPost]
        public async Task<BizflowConfigDto> CreateAsync([FromBody]BizflowConfigCreateDto input)
        {
            return await _bizflowConfigService.CreateAsync(input);
        }

        [HttpDelete]
        public async Task DeleteAsync(Guid id)
        {
            await _bizflowConfigService.DeleteAsync(id);
        }

        [HttpGet]
        public async Task<BizflowConfigDto> GetAsync(Guid id)
        {
            return await _bizflowConfigService.GetAsync(id);
        }

        [HttpGet]
        [Route("list")]
        public async Task<PagedResultDto<BizflowConfigDto>> GetListAsync([FromQuery]BizflowConfigInput input)
        {
            return await _bizflowConfigService.GetListAsync(input);
        }

        [HttpPut]
        public async Task<BizflowConfigDto> UpdateAsync(Guid id, BizflowConfigUpdateDto input)
        {
            return await _bizflowConfigService.UpdateAsync(id, input);
        }
    }
}
